export default {
	/**
	 * 姓名变*
	 */
	onNameStar(name) {
		var nameList = name.split("");
		var last = [];
		for (let i = 0; i < nameList.length; i++) {
			var str = nameList[i];
			if (i === nameList.length - 1) {
				last.push(str);
			} else {
				last.push("*");
			}
		}
		return last.join("");
	},
	/**
	 * 身份证号
	 */
	onIdCardStar(idCard) {
		var list = idCard.split("");
		var last = [];
		for (let i = 0; i < list.length; i++) {
			var str = list[i];
			if (i === list.length - 1 || i === 0) {
				last.push(str);
			} else {
				last.push("*");
			}
		}
		return last.join("");
	},
	/**
	 * 选择图片
	 */
	onChooseImage(count, callBack) {
		uni.chooseFile({
			count: count,
			type: "image",
			sourceType: ["album", "camera"],
			success: res => {
				if (callBack) {
					callBack(res.tempFilePaths);
				}
			}
		})
	},
	/**
	 * 手机号
	 */
	onMobileStar(mobile) {
		var list = mobile.split("");
		list[3] = "*"
		list[4] = "*"
		list[5] = "*"
		list[6] = "*"
		list[7] = "*"
		list[8] = "*"
		return list.join("");
	},
}